window: Set cursor on the right surface
authorMatthias Clasen <mclasen@redhat.com>
Fri, 26 Apr 2019 23:48:13 +0000 (23:48 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 29 Apr 2019 18:51:55 +0000 (14:51 -0400)
Set the cursor on the surface of the target
widget, not the surface of some of its parents.

This does not make a difference currently.
But it will in the future, when we have
parented widgets with surfaces.

gtk/gtkwindow.c

index 0fdb869bc7b97ef8e0d871688a7615ff0fe53510..04c1decdfb7ad523cbe3e1ee472cae2845ad71a5 100644 (file)
@@ -9876,6 +9876,9 @@ update_cursor (GtkWindow *toplevel,
                GtkWidget *target)
 {
   GdkCursor *cursor = NULL;
+  GdkSurface *surface;
+
+  surface = gtk_widget_get_surface (target);
 
   if (grab_widget && !gtk_widget_is_ancestor (target, grab_widget))
     {
@@ -9903,8 +9906,7 @@ update_cursor (GtkWindow *toplevel,
         }
     }
 
-  gdk_surface_set_device_cursor (gtk_widget_get_surface (GTK_WIDGET (toplevel)),
-                                 device, cursor);
+  gdk_surface_set_device_cursor (surface, device, cursor);
 }
 
 void